﻿using XLZF.MicroServices.IRepository;
using XLZF.MicroServices.Models;

namespace XLZF.MicroServices.Repository;

public class ClothingPicDictRepository : IClothingPicDictRepository
{
    private static ModelMigration.XLZFContext context = new ModelMigration.XLZFContext();

    private IRepository<ClothingPicDict> _repository = new Repository<ClothingPicDict>(context);

    public async Task<int> AddClothingPicDict(ClothingPicDict ClothingPicDict)
    {
        return await _repository.Add(ClothingPicDict);
    }

    public int DelClothingPicDict(ClothingPicDict ClothingPicDict)
    {
        return _repository.Remove(ClothingPicDict);
    }

    public int EditClothingPicDict(ClothingPicDict ClothingPicDict)
    {
        return _repository.Update(ClothingPicDict);
    }

    public List<ClothingPicDict> GetClothingPicDict()
    {
        return _repository.GetAll().ToList();
    }

    public ClothingPicDict GetClothingPicDictSing(string ID)
    {
        return _repository.GetModel(p => p.ID == ID);
    }

    public Page<ClothingPicDict> GetClothingPageData(string name, bool isAsc, int pageIndex, int pageSize)
    {
        throw new NotImplementedException();
    }
}
